package com.polukeuro.app.client.events;

import com.google.gwt.user.client.ui.Widget;

public class GlobalErrorEvent extends CustomErrorEvent {
	
	private static Type<CustomErrorHandler> TYPE = new Type<CustomErrorHandler>();

	private final String message;
	
	public GlobalErrorEvent(Widget widget, String message) {
		super(widget);
		this.message = message;
	}

	@Override
	protected void dispatch(CustomErrorHandler handler) {
		handler.onGlobalError(this);
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<CustomErrorHandler> getAssociatedType() {
		return TYPE;
	}

	public String getMessage() {
		return message;
	}

	public static Type<CustomErrorHandler> getType() {
		return TYPE;
	}

}
